import time
import unittest
from page.community_page import CommunityPage


class SubScribeTestCase(unittest.TestCase):
    @classmethod
    def setUpClass(cls) -> None:
        cls.community = CommunityPage(appPackage='com.nearme.gamecenter', appActivity='.ui.activity.SplashActivity')

    def test_01_subscribe(self):
        time.sleep(5)
        self.community.community_click()
        self.community.plate_click()
        self.community.plate_game_click()
        self.community.subscribe_click()
        text1 = self.community.get_game_name()
        self.community.back_button_click()
        text2 = self.community.get_subscribe_name()
        time.sleep(5)
        self.assertEqual(text1, text2, msg="断言游戏版块订阅成功")

    @classmethod
    def tearDownClass(cls) -> None:
        cls.community.quit()


if __name__ == '__main__':
    unittest.main(verbosity=2)
